package com.ssy.lingxi.marketing.model.constant;

import java.util.Arrays;

/**
 * 抽奖类型：1-订单抽奖 2-积分抽奖 3-行为抽奖 4-活动抽奖
 * @author yzc
 * @version 2.0.0
 * @date 2021/10/29
 */
public enum LotteryTypeEnum {

    ORDER(1, "订单抽奖"),
    INTEGRAL(2, "扣分抽奖"),
    BEHAVIOR(3, "行为抽奖"),
    ACTIVITY(4, "活动抽奖"),
    ;

    private final Integer code;
    private final String message;

    LotteryTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(LotteryTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().map(LotteryTypeEnum::getMessage).orElse("");
    }


}
